<?php

namespace app\index\controller;

use think\Controller;
use think\Request;

class Base extends Controller
{

    public function __construct(){

        parent::__construct();

        // 获取无线级分类方法
        $oneTree = \app\admin\model\Category::select();

        // 转换成数组结构
        foreach($oneTree as &$v)
        {
            $v = $v->toArray();
        }

        unset($v);

        $category = get_three_tree($oneTree);

        $this->assign("category",$category);
    }
}
